<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
    <body>
        <ui:composition template="../templates/default3.xhtml">  
            <ui:define name="content">
                <h:form binding="#{customerManagerBean.loadAssignExecutive}">
                    <p:messages id ="error" />
                    <p:panel header="Customer Information" id="assignExecutive">
                        <table> 
                            <tr>
                                <td width="135px"> Company:</td>
                                <td>
                                    <b><h:outputText id="company" value="#{customerManagerBean.company}"/></b>
                                </td>
                            </tr>
                            <tr>
                                <td>Person in-charge:</td>
                                <td>
                                    <h:outputText id="name" value="#{customerManagerBean.firstName} #{customerManagerBean.lastName}"/>
                                </td>
                            </tr>
                            <tr>
                                <td>Type:</td>
                                <td><h:outputText id="type" value="#{customerManagerBean.type}"/></td>
                            </tr>
                            <tr>
                                <td>Industry:</td>
                                <td><h:outputText id="industry" value="#{customerManagerBean.type}"/></td>
                            </tr>
                            <tr>
                                <td>Annual revenue:</td>
                                <td><h:outputText  id="revenue" value="#{customerManagerBean.revenue}"/></td>
                            </tr>
                        </table>
                    </p:panel>
                    <p:panel header="Select executive" id="selectExecutive">
                        <p:dataTable id="employee" var="employee" value="#{customerManagerBean.employees}" selectionMode="single" 
                                     selection="#{customerManagerBean.employee}" paginator="true" rows="10" 
                                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">                    
                            <p:column filterBy="#{employee.name}" headerText="First Name" filterMatchMode="contains">  
                                <h:outputText value="#{employee.name}"/>  
                            </p:column> 
                            <p:column filterBy="#{employee.designation}" headerText="Company" filterMatchMode="contains">  
                                <h:outputText value="#{employee.designation}"/>  
                            </p:column> 
                            <p:column filterBy="#{employee.contactOffice}" headerText="No. of assignment" filterMatchMode="contains">  
                                <h:outputText value="#{employee.contactOffice}"/>  
                            </p:column>                                                                                             
                        </p:dataTable>
                        
                    </p:panel>
                    <table class="panel">
                        <tr>
                            <td align="center">
                                <p:commandButton value="Assign" actionListener="#{customerManagerBean.assign}" update ="error" ajax="true"/>
                            </td>
                        </tr>
                    </table>
                </h:form>
            </ui:define>
        </ui:composition>
    </body>
</html>